3.4.35 \(\int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx\) [335]

3.4.35.1 Optimal result
3.4.35.2 Mathematica [B] (verified)
3.4.35.3 Rubi [A] (verified)
3.4.35.4 Maple [A] (verified)
3.4.35.5 Fricas [A] (verification not implemented)
3.4.35.6 Sympy [F]
3.4.35.7 Maxima [B] (verification not implemented)
3.4.35.8 Giac [A] (verification not implemented)
3.4.35.9 Mupad [B] (verification not implemented)

3.4.35.1 Optimal result

Integrand size = 32, antiderivative size = 44 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx=\frac {C \text {arctanh}(\sin (c+d x))}{a d}+\frac {(B-C) \tan (c+d x)}{a d (1+\sec (c+d x))} \]

output
C*arctanh(sin(d*x+c))/a/d+(B-C)*tan(d*x+c)/a/d/(1+sec(d*x+c))
 
3.4.35.2 Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(106\) vs. \(2(44)=88\).

Time = 0.62 (sec) , antiderivative size = 106, normalized size of antiderivative = 2.41 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx=\frac {2 \cos \left (\frac {1}{2} (c+d x)\right ) \left (C \cos \left (\frac {1}{2} (c+d x)\right ) \left (-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+(B-C) \sin \left (\frac {1}{2} (c+d x)\right )\right )}{a d (1+\cos (c+d x))} \]

input
Integrate[(B*Sec[c + d*x] + C*Sec[c + d*x]^2)/(a + a*Sec[c + d*x]),x]
 
output
(2*Cos[(c + d*x)/2]*(C*Cos[(c + d*x)/2]*(-Log[Cos[(c + d*x)/2] - Sin[(c + 
d*x)/2]] + Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) + (B - C)*Sin[(c + d* 
x)/2]))/(a*d*(1 + Cos[c + d*x]))
 
3.4.35.3 Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {3042, 4538, 27, 3042, 4257, 4281}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a \sec (c+d x)+a} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {B \csc \left (c+d x+\frac {\pi }{2}\right )+C \csc \left (c+d x+\frac {\pi }{2}\right )^2}{a \csc \left (c+d x+\frac {\pi }{2}\right )+a}dx\)

\(\Big \downarrow \) 4538

\(\displaystyle \frac {\int \frac {(B-C) \sec (c+d x)}{\sec (c+d x)+1}dx}{a}+\frac {C \int \sec (c+d x)dx}{a}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {(B-C) \int \frac {\sec (c+d x)}{\sec (c+d x)+1}dx}{a}+\frac {C \int \sec (c+d x)dx}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {(B-C) \int \frac {\csc \left (c+d x+\frac {\pi }{2}\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )+1}dx}{a}+\frac {C \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{a}\)

\(\Big \downarrow \) 4257

\(\displaystyle \frac {(B-C) \int \frac {\csc \left (c+d x+\frac {\pi }{2}\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )+1}dx}{a}+\frac {C \text {arctanh}(\sin (c+d x))}{a d}\)

\(\Big \downarrow \) 4281

\(\displaystyle \frac {C \text {arctanh}(\sin (c+d x))}{a d}+\frac {(B-C) \tan (c+d x)}{a d (\sec (c+d x)+1)}\)

input
Int[(B*Sec[c + d*x] + C*Sec[c + d*x]^2)/(a + a*Sec[c + d*x]),x]
 
output
(C*ArcTanh[Sin[c + d*x]])/(a*d) + ((B - C)*Tan[c + d*x])/(a*d*(1 + Sec[c + 
 d*x]))
 

3.4.35.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 

rule 4281
Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbo 
l] :> Simp[-Cot[e + f*x]/(f*(b + a*Csc[e + f*x])), x] /; FreeQ[{a, b, e, f} 
, x] && EqQ[a^2 - b^2, 0]
 

rule 4538
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. 
))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[C/b   Int[Csc[ 
e + f*x], x], x] + Simp[1/b   Int[(A*b + (b*B - a*C)*Csc[e + f*x])/(a + b*C 
sc[e + f*x]), x], x] /; FreeQ[{a, b, e, f, A, B, C}, x]
 
3.4.35.4 Maple [A] (verified)

Time = 0.12 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.20

method result size
parallelrisch \(\frac {-C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (B -C \right )}{a d}\) \(53\)
derivativedivides \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C -C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d a}\) \(61\)
default \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C -C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d a}\) \(61\)
risch \(\frac {2 i B}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}-\frac {2 i C}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{a d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{a d}\) \(91\)
norman \(\frac {\frac {\left (B -C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{a d}-\frac {\left (B -C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}+\frac {C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a d}-\frac {C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a d}\) \(105\)

input
int((B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x,method=_RETURNVERBOSE 
)
 
output
(-C*ln(tan(1/2*d*x+1/2*c)-1)+C*ln(tan(1/2*d*x+1/2*c)+1)+tan(1/2*d*x+1/2*c) 
*(B-C))/a/d
 
3.4.35.5 Fricas [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.68 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx=\frac {{\left (C \cos \left (d x + c\right ) + C\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (C \cos \left (d x + c\right ) + C\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (B - C\right )} \sin \left (d x + c\right )}{2 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}} \]

input
integrate((B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x, algorithm="fri 
cas")
 
output
1/2*((C*cos(d*x + c) + C)*log(sin(d*x + c) + 1) - (C*cos(d*x + c) + C)*log 
(-sin(d*x + c) + 1) + 2*(B - C)*sin(d*x + c))/(a*d*cos(d*x + c) + a*d)
 
3.4.35.6 Sympy [F]

\[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx=\frac {\int \frac {B \sec {\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \sec ^{2}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \]

input
integrate((B*sec(d*x+c)+C*sec(d*x+c)**2)/(a+a*sec(d*x+c)),x)
 
output
(Integral(B*sec(c + d*x)/(sec(c + d*x) + 1), x) + Integral(C*sec(c + d*x)* 
*2/(sec(c + d*x) + 1), x))/a
 
3.4.35.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 99 vs. \(2 (44) = 88\).

Time = 0.23 (sec) , antiderivative size = 99, normalized size of antiderivative = 2.25 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx=\frac {C {\left (\frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} + \frac {B \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{d} \]

input
integrate((B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x, algorithm="max 
ima")
 
output
(C*(log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a - log(sin(d*x + c)/(cos(d*x 
 + c) + 1) - 1)/a - sin(d*x + c)/(a*(cos(d*x + c) + 1))) + B*sin(d*x + c)/ 
(a*(cos(d*x + c) + 1)))/d
 
3.4.35.8 Giac [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.59 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx=\frac {\frac {C \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a} - \frac {C \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a} + \frac {B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a}}{d} \]

input
integrate((B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x, algorithm="gia 
c")
 
output
(C*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a - C*log(abs(tan(1/2*d*x + 1/2*c) - 
 1))/a + (B*tan(1/2*d*x + 1/2*c) - C*tan(1/2*d*x + 1/2*c))/a)/d
 
3.4.35.9 Mupad [B] (verification not implemented)

Time = 15.85 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.93 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{a+a \sec (c+d x)} \, dx=\frac {2\,C\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a\,d}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (B-C\right )}{a\,d} \]

input
int((B/cos(c + d*x) + C/cos(c + d*x)^2)/(a + a/cos(c + d*x)),x)
 
output
(2*C*atanh(tan(c/2 + (d*x)/2)))/(a*d) + (tan(c/2 + (d*x)/2)*(B - C))/(a*d)